import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/tailwendcss.css";

import { Picker } from "vant";
import "vant/lib/picker/style";
Vue.use(Picker);
import { DatetimePicker } from "vant";
import "vant/lib/datetime-picker/style";
Vue.use(DatetimePicker);
import { Button } from "vant";
import "vant/lib/button/style";
Vue.use(Button);
import { Popup, Field, Divider } from "vant";
import "vant/lib/popup/style";
import "vant/lib/field/style";
import "vant/lib/divider/style";
Vue.use(Popup).use(Field).use(Divider);
import { Step, Steps } from "vant";
import "vant/lib/step/style";
import "vant/lib/steps/style";
import { PullRefresh } from "vant";

Vue.use(PullRefresh);
Vue.use(Step);
Vue.use(Steps);
import { Loading } from "vant";
import "vant/lib/loading/style";
Vue.use(Loading);
import { Toast } from "vant";
import "vant/lib/toast/style";
Vue.prototype.$Toast = Toast;
import { Swipe, SwipeItem } from "vant";
import "vant/lib/swipe/style";
import "vant/lib/swipe-item/style";
Vue.use(Swipe);
Vue.use(SwipeItem);
import { Uploader } from "vant";
import "vant/lib/uploader/style";
Vue.use(Uploader);
import { Icon } from "vant";
import "vant/lib/icon/style";
Vue.use(Icon);
import { Notify } from "vant";
import "vant/lib/notify/style";
Vue.use(Notify);
import { List } from "vant";
import "vant/lib/list/style";
Vue.use(List);
import { Search } from "vant";
import "vant/lib/search/style";
Vue.use(Search);
import { Dialog } from "vant";
import "vant/lib/dialog/style";
Vue.use(Dialog);
import { DropdownMenu, DropdownItem } from "vant";
import "vant/lib/dropdown-menu/style";
import "vant/lib/dropdown-item/style";
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
import "vant/lib/image-preview/style";
import { Tab, Tabs } from "vant";
Vue.use(Tab).use(Tabs);
import "vant/lib/tabs/style";

import VueI18n from "vue-i18n";

Vue.use(VueI18n);

import i18n from "./langs/index";

Vue.config.productionTip = false;

import elementui from "./utils/elementui";
Vue.use(elementui);

router.afterEach(() => {
  // 路由切换后滚动到顶部
  window.scrollTo(0, 0);
});

new Vue({
  router,
  store,
  i18n,
  render: (h) => h(App),
}).$mount("#app");
